function Tree(options) {
	let self = $.extend(this, options);
	self.init = function () {
		if (!$.jstree) {
			requirejs(['jstree'], () => {
				self.init();
			})
			return false;
		}
		$(options.container).bind("load_node.jstree", function (e, data) {
			// 展开所有节点
			$(this).jstree('open_all');

			if (options.load_callback) {
				options.load_callback(e, data);
			}

		}).bind('select_node.jstree', function (event, data) {
			if (options.select_callback) {
				options.select_callback(data)
			}
		}).bind('changed.jstree', function (event, data) {
			if (options.change_callback) {
				options.change_callback(data)
			}
			// $(options.container).jstree().get_checked(true);
		});

		self.jstree = $(options.container).jstree({
			'core': { // 核心的配置
				"data": options.data,
				"check_callback": true
			},
			"checkbox": {
				"keep_selected_style": true,
				"three_state": options.three_state == false ? false : true // 父子联动
			},
			rules: {
				draggable: "all" //这个设置可以使得节点进行拖动操作
			},
			"contextmenu": {
				select_node: true,
				show_at_node: true,
				items: {
					"新建菜单": {
						"label": "新建菜单",
						"icon": "icon fa-plus",
						"action": function (data) {
							let inst = $.jstree.reference(data.reference),
								obj = inst.get_node(data.reference);
							inst.create_node(obj, {}, "last", function (new_node) {
								try {
									new_node.text = "新建菜单";
									inst.edit(new_node);
								} catch (ex) {
									setTimeout(function () {
										inst.edit(new_node);
									}, 0);
								}
							});
						}
					},
					"修改菜单": {
						"separator_before": false,
						"separator_after": false,
						"_disabled": false, //(this.check("rename_node", data.reference, this.get_parent(data.reference), "")),
						"label": "修改菜单",
						"icon": "icon fa-pencil",
						"action": function (data) {
							let inst = $.jstree.reference(data.reference),
								obj = inst.get_node(data.reference);
							inst.edit(obj);
						}
					},
					"删除菜单": {
						"separator_before": false,
						"separator_after": false,
						"_disabled": false,
						"label": "删除菜单",
						"icon": "icon fa-remove",
						"action": function (data) {
							let inst = $.jstree.reference(data.reference),
								obj = inst.get_node(data.reference);
							if (inst.is_selected(obj)) {
								inst.delete_node(inst.get_selected());
							} else {
								inst.delete_node(obj);
							}
						}
					}
				}
			},
			"plugins": options.plugins || [] //["checkbox", "contextmenu", "dnd", "sort"]

		});


		//$(options.container).data('jstree', self.jstree);
	};
	return self;
};
//https://www.jstree.com/api/#/